﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;

using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Windows.Media;
using System.IO.IsolatedStorage;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using JiveMessenger.ViewModels;
using GalaSoft.MvvmLight.Messaging;


namespace JiveMessenger.Views
{
    public partial class GetEmoticonsPage : PhoneApplicationPage
    {
        public GetEmoticonsPage()
        {
            InitializeComponent();
            //ProgressIndicator prog = new ProgressIndicator();
            //prog.IsIndeterminate = false;
            //prog.Text = "Jive Messenger";
            //prog.IsVisible = true;
            //SystemTray.SetProgressIndicator(this, prog);
        }


        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            string loadedUserId = string.Empty; ;
            NavigationContext.QueryString.TryGetValue("userID", out loadedUserId);

            if (this.DataContext!=null)
            {
                ((ViewModelGetEmoticonsPage)this.DataContext).LoadUserCommand.Execute(loadedUserId);
            }
        }
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            ViewModelLocator.CleanupViewModelGetEmoticonsPage();
            base.OnNavigatedFrom(e);
        }
    }
}